package com.mew.common.enm;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

public enum RoomType {
    One(1),      // 初级场
    Two(2),      // 中级场
    Three(3),    // 高级场
    Four(4)      // 大师级场
    ;

    private final static Map<Integer, RoomType> stateMap
            = Arrays.stream(RoomType.values()).collect(Collectors.toMap(RoomType::code, code -> code));

    private final int code;

    RoomType(final int code) {
        this.code = code;
    }

    public int code() {
        return this.code;
    }

    public static RoomType parse(int code) {
        return stateMap.get(code);
    }


}
